home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / buddy / samperr.cls < prev   
Text File  |  1996-04-16  |  1KB  |  55 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "Class1"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Public Sub A_ReadMe()
  9. 'This template is designed for use with the RAD-Copy Buddy.
  10. '
  11. 'Purpose:   This template provides OLE Server and Client
  12. '           error handling routines.
  13. '
  14. 'Usage:     1) Change {{Project}} to a descriptive name
  15. '              OTHER THAN the OLE name of your project.
  16. '           2) Update the error handling action to
  17. '              suit your particular app.
  18. '           3) RAD-Copy the appropriate procedure into all
  19. '              procedures in your project.
  20. '
  21. 'Comments:  Server Error Handler will always return the
  22. '           original offending procedure and error, no
  23. '           matter how deeply nested within the Server's
  24. '           object hierarchy.
  25. '
  26. 'Tags:
  27. '{{Project}}
  28. End Sub
  29.  
  30.  
  31. Public Sub ServerError()
  32. On Error GoTo ErrorHandler:
  33.  
  34. ErrorHandler:                     '-1 Start From Bottom!
  35.     If Left$(Err.Source, Len("Project")) = "Project" Then
  36.         Err.Raise Err.Number, Err.Source
  37.     Else
  38.         Err.Raise Err.Number, "Project.ModuleName.ProcName"
  39.     End If
  40.  
  41.     Exit Sub
  42.  
  43.  
  44.  
  45. End Sub
  46.  
  47. Public Sub ClientError()
  48. On Error GoTo ErrorHandler:
  49.  
  50. ErrorHandler:                    '-1 Start From Bottom!
  51.     MsgBox "Error: " & Error$(Err.Number) & Chr$(13) _
  52.      & "Occurred in :" & Err.Source, 16, "Error Encountered"
  53.         Exit Sub
  54. End Sub
  55.